package cn.ynrcb.personnelfile.admin.dao;

import cn.ynrcb.personnelfile.admin.entity.SmsLogEntity;
import cn.ynrcb.personnelfile.admin.vo.SmsLogVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 短信发送日志表
 *
 * @author wujianfan
 * @email fanxipo@qq.com
 * @date 2021-05-12 16:30:58
 */
@Mapper
public interface SmsLogDao extends BaseMapper<SmsLogEntity> {

    List<SmsLogVo> listOfOpLog(Page<SmsLogVo> page, @Param("map") Map<String, Object> params);

    /**
     * 查询满足条件的列表
     *
     * @param phone
     * @param type
     * @param status
     * @return
     */
    @Select("SELECT * FROM tb_sms_log WHERE phone = #{phone} AND type = #{type} AND status = #{status} ORDER BY create_time DESC")
    List<SmsLogEntity> getNewList(String phone, Integer type, Integer status);
}
